import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/comp',
    name: 'comp',
    meta: {
      title: '组件示例'
    },
    component: () => import('@/layout/index.vue'),
    children: [
      {
        path: 'table',
        name: 'comp_table',
        meta: {
          title: '表格'
        },
        component: () => import('@/views/comp/table.vue'),
        children: [
          {
            path: 'basic',
            name: 'comp_table_basic',
            meta: {
              title: '基础表格',
              alwaysShow: true
            },
            component: () => import('@/views/comp/table/basic.vue'),
            children: [
              {
                path: 'one',
                name: 'comp_table_basic_one',
                meta: {
                  title: 'One'
                },
                component: () => import('@/views/comp/table/basic/one.vue')
              }
            ]
          },
          {
            path: 'edit-cell',
            name: 'comp_table_edit-cell',
            meta: {
              title: '单元格编辑'
            },
            component: () => import('@/views/comp/table/edit-cell.vue')
          },
          {
            path: 'edit-row',
            name: 'comp_table_edit-row',
            meta: {
              title: '整行编辑'
            },
            component: () => import('@/views/comp/table/edit-row.vue')
          }
        ]
      },
      {
        path: 'upload',
        name: 'comp_upload',
        meta: {
          title: '上传图片'
        },
        component: () => import('@/views/comp/upload.vue')
      }
    ]
  }
]

export default routes
